package com.lyd.sweet.mybatis.mapper;

import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.annotation.RegisterMapper;

/**
 * 类的用途
 *
 * @author 木木
 **/
@RegisterMapper
public interface SelectMapper<T> {

    /**
     * 根据单个字段查询
     *
     * @param key
     * @param object
     * @return
     */
    @org.apache.ibatis.annotations.SelectProvider(type = SelectProvider.class, method = "dynamicSQL")
    T selectOneByField(@Param("field") String key, @Param("value") Object object);

    /**
     * 根据两个字段查询
     * @param oneKey
     * @param oneObject
     * @param twoKey
     * @param twoObject
     * @return
     */
    @org.apache.ibatis.annotations.SelectProvider(type = SelectProvider.class, method = "dynamicSQL")
    T selectOneByTwoField(@Param("oneField") String oneKey, @Param("oneValue") Object oneObject,@Param("twoField") String twoKey, @Param("twoValue") Object twoObject);
}
